clear 

use "workingdirectory\Knutsen_Wig_CPS_final.dta"

*these models replicate the coup and civil war regressions in Knutsen and Wig 2014
******************************************************
**********        CIVIL WAR LOGITS     ***************
******************************************************

*TABLE A29

*These models replicate cederman et.al 2010 (adding growth and ethnic fractionalization), and include different democracy measures

****DD democracy
logit acdonset2 democracy lgdpcapl  lpopl  gwthover5yrs ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year , cluster(gwno)
estimates store civ1

****Democracy (without alternation rule)
logit acdonset2 democracynoalt lgdpcapl lpopl  gwthover5yrs ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year , cluster(gwno)
estimates store civ2

        *this is to exclude observations from sample (BMR)
logit acdonset2 bdemocracy lgdpcapl  lpopl  gwthover5yrs  ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year , cluster(gwno)
estimates store bmr1

***ON bmr sample
logit acdonset2 democracy lgdpcapl  lpopl  gwthover5yrs  ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year if _est_bmr1==1, cluster(gwno)
estimates store civ3

****Boix democracy
logit acdonset2 bdemocracy lgdpcapl  lpopl  gwthover5yrs  ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year , cluster(gwno)
estimates store civ4

estout civ1 civ2 civ3 civ4, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


**************************
*** Real Time vs. DD  ****
**************************

*TABLE A30

*original
logit acdonset2 democracy lgdpcapl  lpopl  gwthover5yrs ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year  if year < 1970, cluster(gwno)
estimates store civ1a

*real-time
logit acdonset2 dem_realtimeDD lgdpcapl  lpopl  gwthover5yrs ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year  if year < 1970, cluster(gwno)
estimates store civ2a

*original
logit acdonset2 democracy lgdpcapl  lpopl  gwthover5yrs ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year  if year < 1980, cluster(gwno)
estimates store civ3a

*real-time
logit acdonset2 dem_realtimeDD lgdpcapl  lpopl  gwthover5yrs ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year  if year < 1980, cluster(gwno)
estimates store civ4a

*original
logit acdonset2 democracy lgdpcapl  lpopl  gwthover5yrs ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year  if year < 1990, cluster(gwno)
estimates store civ5a

*real-time
logit acdonset2 dem_realtimeDD lgdpcapl  lpopl  gwthover5yrs ethnfrac acdpeaceyears acdspline1 acdspline2  acdspline3  year  if year < 1990, cluster(gwno)
estimates store civ6a


estout civ1a civ2a civ3a civ4a civ5a civ6a, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)




******************************************************
**********        COUP LOGITS          ***************
******************************************************


*TABLE A31

*these models replicate powell and Thyne 2012 (JCR), and include different democracy measures
*note: Powell and thyne create a regime-measure with three categories "dem", "auth" and the ref.cat which is anocracies. We drop all regime variables from their
*regressions and only use our binary measure

****REPLICATING POWELL AND THYNE

logit attempt dem auth milreg chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3 , cluster(gwno)
estimates store coup0

****Replicating powell and thyne with binary democracy measure

     *DD
logit attempt democracy milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3 , cluster(gwno)
estimates store coup1

     *Democracy (without alternation rule)
logit attempt democracynoalt milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3 , cluster(gwno)
estimates store coup2

     *Democracy on bmr sample
logit attempt bdemocracy milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3   , cluster(gwno)
estimates store bmr2	 
	 
logit attempt democracy milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3 if _est_bmr2==1 , cluster(gwno)
estimates store coup3

     *Boix democracy
logit attempt bdemocracy milreg  soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3 , cluster(gwno)
estimates store coup4


estout  coup1 coup2 coup3 coup4, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


**************************
*** Real Time vs. DD  ****
**************************

*TABLE A32

*original
logit attempt democracy milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3  if year < 1970, cluster(gwno)
estimates store coup1a

*real-time
logit attempt dem_realtimeDD milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3 if year < 1970, cluster(gwno)
estimates store coup2a

*original
logit attempt democracy milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3  if year < 1980, cluster(gwno)
estimates store coup3a

*real-time
logit attempt dem_realtimeDD milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3  if year < 1980, cluster(gwno)
estimates store coup4a

*original
logit attempt democracy milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3 if year < 1990, cluster(gwno)
estimates store coup5a

*real-time
logit attempt dem_realtimeDD milreg soquall chmilex lmilper chgdp lgdppcl instab powthy_peace spline1 spline2 spline3  if year < 1990, cluster(gwno)
estimates store coup6a



estout  coup1a coup2a coup3a coup4a coup5a coup6a, cells(b(star fmt(%9.3f)) t(par fmt(%9.2f))) starlevels (* 0.10 ** 0.05 *** 0.01) stats (N)style (tex)


*********************************************************************************************************************************************************
